package com.qianji.petmall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qianji.common.to.SkuHasStockVo;
import com.qianji.common.to.mq.OrderTo;
import com.qianji.common.to.mq.StockLockedTo;
import com.qianji.common.utils.PageUtils;
import com.qianji.petmall.ware.entity.WareSkuEntity;
import com.qianji.petmall.ware.vo.WareSkuLockVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author xiaoxin
 * @email 485350978@qq.com
 * @date 2022-01-07 15:25:56
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryPageBySku(Map<String, Object> params);

    void updateWork(Long skuId, Integer skuNum, Long wareId);

    List<SkuHasStockVo> hasSkuStock(List<Long> skuId);
    //锁定库存
    boolean orderLock(WareSkuLockVo vo);

    void releaseLock(StockLockedTo to);

    void releaseLock(OrderTo to);
    //解锁库存
//    void releaseLock();

}

